<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hl7-org:v3 ..\sdschemas\CDA.xsd">
    <#assign templateData={"title":"预防接种报告", "code":"HSDB03.01", "templateId":"2.16.156.10011.2.1.1.9"}>
    <#include "fragment/header/header.ftl">
    <component>
        <structuredBody>
            <!-- 搬迁信息章节 -->
            <#if docData.banQianXX??>
                <component>
                    <section>
                        <code displayName="搬迁信息"/>
                        <text/>
                        <entry>
                            <observation classCode="OBS" moodCode="EVN">
                                <code/>
                                <effectiveTime>
                                    <!--迁入时间-->
                                    <low value="${docData.banQianXX.qianRuSJ}"/>
                                    <!--迁出时间-->
                                    <high value="${docData.banQianXX.qianChuSJ}"/>
                                </effectiveTime>
                                <entryRelationship typeCode="CAUS" inversionInd="false">
                                    <observation classCode="OBS" moodCode="EVN">
                                        <code code="DE02.01.028.00" codeSystem="2.16.156.10011.2.2.1"/>
                                        <value xsi:type="ST">${docData.banQianXX.qianChuYY}</value>
                                    </observation>
                                </entryRelationship>
                            </observation>
                        </entry>
                    </section>
                </component>
            </#if>
            <!-- 既往史章节（新生儿过往史信息） -->
            <#-- 0..1 -->
            <#if docData.xinShengEJWS??>
                <component>
                    <section>
                        <code code="11348-0" displayName="HISTORY OF PAST ILLNESS" codeSystem="2.16.840.1.113883.6.1"
                              codeSystemName="LOINC"/>
                        <text/>
                        <#if docData.xinShengEJWS.jieZhongYCFYS??>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE04.01.103.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="ST">${docData.xinShengEJWS.jieZhongYCFYS}</value>
                                </observation>
                            </entry>
                        </#if>
                        <#if docData.xinShengEJWS.jieZhongJJ??>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE06.00.054.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="ST">${docData.xinShengEJWS.jieZhongJJ}</value>
                                </observation>
                            </entry>
                        </#if>
                        <!-- 传染病史 -->
                        <#if docData.xinShengEJWS.chuanRanBS??>
                            <entry>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE02.10.008.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="ST">${docData.xinShengEJWS.chuanRanBS}</value>
                                </observation>
                            </entry>
                        </#if>
                    </section>
                </component>
            </#if>
            <!-- 手术操作章节（接种信息） -->
            <#-- 1..1 -->
            <component>
                <section>
                    <code code="47519-4" displayName="HISTORY OF PROCEDURES" codeSystem="2.16.840.1.113883.6.1"
                          codeSystemName="LOINC"/>
                    <text/>
                    <#if docData.jieZhongXX??>
                        <#list docData.jieZhongXX as item>
                            <!-- 接种信息 -->
                            <entry>
                                <procedure classCode="PROC" moodCode="EVN">
                                    <code/>
                                    <!-- 接种日期 -->
                                    <effectiveTime value="${item.jieZhongSJ}"/>  <!--1-->
                                    <!-- 接种剂次 -->
                                    <priorityCode>
                                        <originalText>${item.jieZhongJC}</originalText><!--1-->
                                    </priorityCode>
                                    <!-- 接种部位 -->
                                    <targetSiteCode>
                                        <originalText>${item.jieZhongBW}</originalText><!--1-->
                                    </targetSiteCode>
                                    <!-- 接种医生 -->
                                    <performer typeCode="PRF">
                                        <assignedEntity classCode="ASSIGNED">
                                            <!-- 接种医生编号 -->
                                            <id root="2.16.156.10011.1.7" extension="${item.jieZhongYSDM}"/>
                                            <assignedPerson classCode="PSN" determinerCode="INSTANCE">
                                                <!-- 接种医生名称 -->
                                                <name>${item.jieZhongYSXM}</name> <!--1-->
                                            </assignedPerson>
                                            <representedOrganization classCode="ORG" determinerCode="INSTANCE">
                                                <!-- 接种机构编号 -->
                                                <id root="2.16.156.10011.1.7" extension="${item.jieZhongJGID}"/>
                                                <!--1-->
                                                <!-- 接种机构名称 -->
                                                <name>${item.jieZhongJGMC}</name>
                                            </representedOrganization>
                                        </assignedEntity>
                                    </performer>
                                    <entryRelationship typeCode="COMP">
                                        <!-- 疫苗信息 -->
                                        <substanceAdministration classCode="SBADM" moodCode="EVN">
                                            <code/>
                                            <!-- 疫苗有效期 -->
                                            <effectiveTime/>    <!--1-->
                                            <consumable typeCode="CSM">
                                                <manufacturedProduct classCode="MANU">
                                                    <!-- 疫苗批号 -->
                                                    <id root="2.16.156.10011.1.7" extension="${item.yiMiaoPH}"/>
                                                    <manufacturedLabeledDrug>
                                                        <code code="${item.yiMiaoMC.code}" xsi:type="CE"
                                                              codeSystem="2.16.156.10011.2.3.1.210"
                                                              displayName="${item.yiMiaoMC.displayName}"
                                                              codeSystemName="疫苗名称代码表"/>
                                                        <name>${item.yiMiaoMC.displayName}</name>     <!--1-->
                                                    </manufacturedLabeledDrug>
                                                    <manufacturerOrganization classCode="ORG" determinerCode="INSTANCE">
                                                        <!-- 疫苗生产厂商编号 -->
                                                        <id root="2.16.156.10011.1.7" extension="${item.yiMiaoSCCSBH}"/>
                                                        <!-- 疫苗生产厂商名称 -->
                                                        <name>${item.yiMiaoSCCSMC}</name>
                                                    </manufacturerOrganization>
                                                </manufacturedProduct>
                                            </consumable>
                                        </substanceAdministration>
                                    </entryRelationship>
                                </procedure>
                            </entry>
                        </#list>
                    </#if>
                </section>
            </component>
            <!-- 接种不良反应章节 -->
            <#-- 0..1 -->
            <#if docData.jieZhongYCFY??>
                <component>
                    <section>
                        <code displayName="疑似预防接种异常反应"/>
                        <text/>
                        <#list docData.jieZhongYCFY as item>
                            <!-- 疑似预防接种异常反应的可疑疫苗名称代码 -->
                            <entry>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE08.50.018.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="CD" displayName="${item.keYiYMDM.displayName}"
                                           code="${item.keYiYMDM.code}" codeSystem="2.16.156.10011.2.3.1.210"
                                           codeSystemName="疫苗名称代码表"/>
                                </observation>
                            </entry>
                            <!-- 疑似预防接种异常反应诊断代码 -->
                            <entry>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE05.01.052.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="CD" code="${item.zhenDuanDM.code}"
                                           displayName="${item.zhenDuanDM.displayName}"
                                           codeSystem="2.16.156.10011.2.3.1.131" codeSystemName="预防接种后不良反应临床诊断代码表"/>
                                </observation>
                            </entry>
                            <!-- 疑似预防接种异常反应发生日期 -->
                            <entry>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE06.00.151.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="TS" value="${item.fanYingRQ}"/>
                                </observation>
                            </entry>
                            <!-- 疑似预防接种异常反应处理结果 -->
                            <entry>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE06.00.150.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="ST">${item.chuLiJG}</value>
                                </observation>
                            </entry>
                        </#list>
                    </section>
                </component>
            </#if>
        </structuredBody>
    </component>
</ClinicalDocument>